package com.eduhzy.ttw.work.mvp.model;

import com.eduhzy.ttw.commonsdk.entity.CommonData;
import com.eduhzy.ttw.commonsdk.entity.MineClassData;
import com.eduhzy.ttw.commonsdk.http.CommonApi;
import com.eduhzy.ttw.work.mvp.contract.PublishWorkContract;
import com.eduhzy.ttw.work.mvp.model.api.service.WorkApi;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;

import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 * @author xubo
 * @date 2018-12-3 10:07:39
 */
@ActivityScope
public class PublishWorkModel extends BaseModel implements PublishWorkContract.Model {


    @Inject
    public PublishWorkModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public Observable<CommonData<List<MineClassData>>> getClassByUser(Map<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(CommonApi.class).getClassByUser(map);
    }

    @Override
    public Observable<CommonData<Map>> create(Map<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(WorkApi.class).create(map);
    }
}